﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.d00_hdaMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>d00_hda</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = d00_hda_MainStore.getAt(index).get('jtbm');
            
			Txtdzbm.setValue(d00_hda_MainStore.getAt(index).get('dzbm'));
			Txthbh.setValue(d00_hda_MainStore.getAt(index).get('hbh'));
			Txtrbh.setValue(d00_hda_MainStore.getAt(index).get('rbh'));
			Txthzxm.setValue(d00_hda_MainStore.getAt(index).get('hzxm'));
			Txthzxb.setValue(d00_hda_MainStore.getAt(index).get('hzxb'));
			Txtsfzh.setValue(d00_hda_MainStore.getAt(index).get('sfzh'));
			Txtzbh.setValue(d00_hda_MainStore.getAt(index).get('zbh'));
			Txtcbh.setValue(d00_hda_MainStore.getAt(index).get('cbh'));
			Txttxdz.setValue(d00_hda_MainStore.getAt(index).get('txdz'));
			Txtyzbm.setValue(d00_hda_MainStore.getAt(index).get('yzbm'));
			Txtdhhm.setValue(d00_hda_MainStore.getAt(index).get('dhhm'));
			Txtdzyx.setValue(d00_hda_MainStore.getAt(index).get('dzyx'));
			Txtjtrs.setValue(d00_hda_MainStore.getAt(index).get('jtrs'));
			TxtNumnyrs.setValue(d00_hda_MainStore.getAt(index).get('nyrs'));
			Txtssdq.setValue(d00_hda_MainStore.getAt(index).get('ssdq'));
			Txtchsx.setValue(d00_hda_MainStore.getAt(index).get('chsx'));
			Txthsx.setValue(d00_hda_MainStore.getAt(index).get('hsx'));
			Txtjzjb.setValue(d00_hda_MainStore.getAt(index).get('jzjb'));
			Txtrcbz.setValue(d00_hda_MainStore.getAt(index).get('rcbz'));
			Txtrcsj.setValue(d00_hda_MainStore.getAt(index).get('rcsj'));
			Txtrcyy.setValue(d00_hda_MainStore.getAt(index).get('rcyy'));
			Txtjhje.setValue(d00_hda_MainStore.getAt(index).get('jhje'));
			Txtsyje.setValue(d00_hda_MainStore.getAt(index).get('syje'));
			TxtNumhbz.setValue(d00_hda_MainStore.getAt(index).get('hbz'));
			Txtjdsj.setValue(d00_hda_MainStore.getAt(index).get('jdsj'));
			Txtdybz.setValue(d00_hda_MainStore.getAt(index).get('dybz'));
			Txthdbz.setValue(d00_hda_MainStore.getAt(index).get('hdbz'));
			Txtylzh.setValue(d00_hda_MainStore.getAt(index).get('ylzh'));
			Txtfzbz.setValue(d00_hda_MainStore.getAt(index).get('fzbz'));
			Txtyhkh.setValue(d00_hda_MainStore.getAt(index).get('yhkh'));
			Txtyhxm.setValue(d00_hda_MainStore.getAt(index).get('yhxm'));
			Txtyhzt.setValue(d00_hda_MainStore.getAt(index).get('yhzt'));

            d00_hda_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--d00_hda表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="d00_hda_MainStore" OnRefreshData="d00_hda_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="jtbm">
                <Fields>
                    
					<ext:RecordField Name="jtbm" />
					<ext:RecordField Name="dzbm" />
					<ext:RecordField Name="hbh" />
					<ext:RecordField Name="rbh" />
					<ext:RecordField Name="hzxm" />
					<ext:RecordField Name="hzxb" />
					<ext:RecordField Name="sfzh" />
					<ext:RecordField Name="zbh" />
					<ext:RecordField Name="cbh" />
					<ext:RecordField Name="txdz" />
					<ext:RecordField Name="yzbm" />
					<ext:RecordField Name="dhhm" />
					<ext:RecordField Name="dzyx" />
					<ext:RecordField Name="jtrs" />
					<ext:RecordField Name="nyrs" />
					<ext:RecordField Name="ssdq" />
					<ext:RecordField Name="chsx" />
					<ext:RecordField Name="hsx" />
					<ext:RecordField Name="jzjb" />
					<ext:RecordField Name="rcbz" />
					<ext:RecordField Name="rcsj" />
					<ext:RecordField Name="rcyy" />
					<ext:RecordField Name="jhje" />
					<ext:RecordField Name="syje" />
					<ext:RecordField Name="hbz" />
					<ext:RecordField Name="jdsj" />
					<ext:RecordField Name="dybz" />
					<ext:RecordField Name="hdbz" />
					<ext:RecordField Name="ylzh" />
					<ext:RecordField Name="fzbz" />
					<ext:RecordField Name="yhkh" />
					<ext:RecordField Name="yhxm" />
					<ext:RecordField Name="yhzt" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--d00_hda页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="d00_hda_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="d00_hda_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{d00_hda_MainForm}.getForm().reset();#{Hid}.setValue('');#{d00_hda_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{d00_hda_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{d00_hda_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(d00_hda_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="d00_hda_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="jtbm" />
                                
								<ext:Column Header="dzbm" Sortable="true" DataIndex="dzbm" />
								<ext:Column Header="hbh" Sortable="true" DataIndex="hbh" />
								<ext:Column Header="rbh" Sortable="true" DataIndex="rbh" />
								<ext:Column Header="hzxm" Sortable="true" DataIndex="hzxm" />
								<ext:Column Header="hzxb" Sortable="true" DataIndex="hzxb" />
								<ext:Column Header="sfzh" Sortable="true" DataIndex="sfzh" />
								<ext:Column Header="zbh" Sortable="true" DataIndex="zbh" />
								<ext:Column Header="cbh" Sortable="true" DataIndex="cbh" />
								<ext:Column Header="txdz" Sortable="true" DataIndex="txdz" />
								<ext:Column Header="yzbm" Sortable="true" DataIndex="yzbm" />
								<ext:Column Header="dhhm" Sortable="true" DataIndex="dhhm" />
								<ext:Column Header="dzyx" Sortable="true" DataIndex="dzyx" />
								<ext:Column Header="jtrs" Sortable="true" DataIndex="jtrs" />
								<ext:Column Header="nyrs" Sortable="true" DataIndex="nyrs" />
								<ext:Column Header="ssdq" Sortable="true" DataIndex="ssdq" />
								<ext:Column Header="chsx" Sortable="true" DataIndex="chsx" />
								<ext:Column Header="hsx" Sortable="true" DataIndex="hsx" />
								<ext:Column Header="jzjb" Sortable="true" DataIndex="jzjb" />
								<ext:Column Header="rcbz" Sortable="true" DataIndex="rcbz" />
								<ext:Column Header="rcsj" Sortable="true" DataIndex="rcsj" />
								<ext:Column Header="rcyy" Sortable="true" DataIndex="rcyy" />
								<ext:Column Header="jhje" Sortable="true" DataIndex="jhje" />
								<ext:Column Header="syje" Sortable="true" DataIndex="syje" />
								<ext:Column Header="hbz" Sortable="true" DataIndex="hbz" />
								<ext:Column Header="jdsj" Sortable="true" DataIndex="jdsj" />
								<ext:Column Header="dybz" Sortable="true" DataIndex="dybz" />
								<ext:Column Header="hdbz" Sortable="true" DataIndex="hdbz" />
								<ext:Column Header="ylzh" Sortable="true" DataIndex="ylzh" />
								<ext:Column Header="fzbz" Sortable="true" DataIndex="fzbz" />
								<ext:Column Header="yhkh" Sortable="true" DataIndex="yhkh" />
								<ext:Column Header="yhxm" Sortable="true" DataIndex="yhxm" />
								<ext:Column Header="yhzt" Sortable="true" DataIndex="yhzt" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="d00_hda_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="dzbm" />
								<ext:StringFilter DataIndex="hbh" />
								<ext:StringFilter DataIndex="rbh" />
								<ext:StringFilter DataIndex="hzxm" />
								<ext:StringFilter DataIndex="hzxb" />
								<ext:StringFilter DataIndex="sfzh" />
								<ext:StringFilter DataIndex="zbh" />
								<ext:StringFilter DataIndex="cbh" />
								<ext:StringFilter DataIndex="txdz" />
								<ext:StringFilter DataIndex="yzbm" />
								<ext:StringFilter DataIndex="dhhm" />
								<ext:StringFilter DataIndex="dzyx" />
								<ext:StringFilter DataIndex="jtrs" />
								<ext:StringFilter DataIndex="ssdq" />
								<ext:StringFilter DataIndex="chsx" />
								<ext:StringFilter DataIndex="hsx" />
								<ext:StringFilter DataIndex="jzjb" />
								<ext:StringFilter DataIndex="rcbz" />
								<ext:StringFilter DataIndex="rcsj" />
								<ext:StringFilter DataIndex="rcyy" />
								<ext:StringFilter DataIndex="jhje" />
								<ext:StringFilter DataIndex="syje" />
								<ext:StringFilter DataIndex="jdsj" />
								<ext:StringFilter DataIndex="dybz" />
								<ext:StringFilter DataIndex="hdbz" />
								<ext:StringFilter DataIndex="ylzh" />
								<ext:StringFilter DataIndex="fzbz" />
								<ext:StringFilter DataIndex="yhkh" />
								<ext:StringFilter DataIndex="yhxm" />
								<ext:StringFilter DataIndex="yhzt" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="d00_hda_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--d00_hda表修改，添加主窗体-->
    <ext:Window ID="d00_hda_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="d00_hda_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="510" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtdzbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dzbm" />
							<ext:TextField ID="Txtrbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rbh" />
							<ext:TextField ID="Txthzxb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hzxb" />
							<ext:TextField ID="Txtzbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zbh" />
							<ext:TextField ID="Txttxdz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="txdz" />
							<ext:TextField ID="Txtdhhm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dhhm" />
							<ext:TextField ID="Txtjtrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jtrs" />
							<ext:TextField ID="Txtssdq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ssdq" />
							<ext:TextField ID="Txthsx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hsx" />
							<ext:TextField ID="Txtrcbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rcbz" />
							<ext:TextField ID="Txtrcyy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rcyy" />
							<ext:TextField ID="Txtsyje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="syje" />
							<ext:TextField ID="Txtjdsj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jdsj" />
							<ext:TextField ID="Txthdbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hdbz" />
							<ext:TextField ID="Txtfzbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="fzbz" />
							<ext:TextField ID="Txtyhxm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yhxm" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txthbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hbh" />
							<ext:TextField ID="Txthzxm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hzxm" />
							<ext:TextField ID="Txtsfzh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sfzh" />
							<ext:TextField ID="Txtcbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="cbh" />
							<ext:TextField ID="Txtyzbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yzbm" />
							<ext:TextField ID="Txtdzyx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dzyx" />
							<ext:NumberField ID="TxtNumnyrs" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="nyrs" />
							<ext:TextField ID="Txtchsx" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="chsx" />
							<ext:TextField ID="Txtjzjb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jzjb" />
							<ext:TextField ID="Txtrcsj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rcsj" />
							<ext:TextField ID="Txtjhje" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jhje" />
							<ext:NumberField ID="TxtNumhbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hbz" />
							<ext:TextField ID="Txtdybz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dybz" />
							<ext:TextField ID="Txtylzh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ylzh" />
							<ext:TextField ID="Txtyhkh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yhkh" />
							<ext:TextField ID="Txtyhzt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yhzt" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{d00_hda_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{d00_hda_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
